<?php use_javascript("BatchCheckAll.js"); ?>
<h1>Untergliederungsverwaltung</h1>

<ul class="horizontal_menu">
  <li>
    <a href="<?php echo url_for('organisational_entity/new') ?>"><img src="/images/24/add2.png" />Neue Untergliederung</a>
  </li>
</ul>

<form action="<?php echo url_for('organisational_entity_collection', array('action' => 'batch')) ?>" method="post">
<table class="formed">
  <thead>
    <tr>
      <th><input type="checkbox" onClick="BatchCheckAll(this);" name="super" id="a" /></th>
      <th>Name</th>
      <th>Aktionen</th>
    </tr>
  </thead>
  <tfoot>
    <tr>
      <td colspan="3">
      <select name="batch_action">
    <option value="">Bitte auswählen...</option>
    <option value="batchDelete">Löschen</option>
  </select>
  <?php $form = new BaseForm(); if ($form->isCSRFProtected()): ?>
    <input type="hidden" name="<?php echo $form->getCSRFFieldName() ?>" value="<?php echo $form->getCSRFToken() ?>" />
  <?php endif; ?>
  <input type="submit" value="Los" />
      </td>
    </tr>
  </tfoot>
  <tbody>
    <?php foreach ($organisational_entities as $i => $organisational_entity): ?>
    <tr class="<?php echo $i % 2 ? 'even' : 'odd'; ?>">
      <td><input type="checkbox" name="ids[]" value="<?php echo $organisational_entity->getPrimaryKey(); ?>" /></td>
      <td><?php echo str_repeat('&nbsp;&nbsp;&nbsp;&nbsp;', $organisational_entity->getLevel()); ?><a href="<?php echo url_for('organisational_entity/show?id='.$organisational_entity->getId()) ?>"><?php echo $organisational_entity->getName() ?></a></td>
      <td>
        <?php include_partial('organisational_entity/organisational_entity_actions', array('organisational_entity' => $organisational_entity)); ?></td>
    </tr>
    <?php endforeach; ?>
  </tbody>
</table>
</form>

  
